<div class="page-5 commonPage">
	<div class="bg-3"></div>
	<?php echo $this->element('sidebar'); ?>
	<div class="box-right zhigh">
        <?php echo $this->element('banner'); ?>
			<div class="title">
                <ul class="breadcrumbs">
                    <li><a href="<?php echo $this->General->base_url() ?>"><img style="position: relative; top: 2px;" src="<?php echo $this->webroot ?>images/home-yl-2.png" /></a></li>
                    <?php
                        foreach($breadcrumbs as $breadcrumb)
                        {
                            echo '<li><a href="'.$this->General->base_url().$breadcrumb['link'].'">'.$breadcrumb['title'].'</a></li>';
                        }
                    ?>
                </ul>
			</div>
		<?php echo $this->element('header'); ?>
		<div class="box-content">
        <?php
            if(!empty($result_search))
            {
        ?>
        
				<ul class="li-page5 list-product list-search">
                    <?php
                        foreach($result_search as $search)
                        {
                            $link = '';
                            if($search['product']['type'] == 'cutkit')
                            {
                                $link = $this->General->base_url() . 'danh-muc-san-pham/' . $search['product']['product_id'] .'-'. $search['link']['link'] .'.html';
                            }
                            else
                            {
                                $link = $this->General->base_url() . 'hoa-si-ti-hon/' . $search['product']['product_id'] .'-'. $search['link']['link'] .'.html';
                            }
                    ?>
					<li style="background: none repeat scroll 0% 0% rgb(0, 145, 144);" bg="009190">
						
						<a href="<?php echo $link ?>">
							<div class="br"></div>
							<img src="<?php echo $this->webroot . $search['image']['name'] ?>">
						</a>
                        <div class="box-price" style="display: block;">
							<div class="shadow-price" style="width:97.5%">
                                <div style="width:100%; padding:0px" class="name">
    								<span class="s-1" style="min-height: 26px; padding: 4px;"><a href="<?php echo $link ?>"><?php echo $search['product_desc']['title'] ?></a></span>
    								</div>
								
                            </div>
						</div>
                    </li>
                    <?php
                        }
                    ?> 
				</ul>
            <?php
                }
                else
                {
                    echo 'Không tìm thấy kết quả tìm kiếm';
                }
            ?>
                
			<div class="clear"></div>
            <div class="product-favorites cutkit-favorites">
                <div class="head-p-favorites">
                    SẢN PHẨM ĐƯỢC ƯA THÍCH                 
                </div>
                <div class="content-p-favorites">
                    <div class="content-slider-bottom" id="uneven_slider">
                    	<div class="uneven">
	                        <?php
                                foreach($products_favorite as $product)
                                {
                                    $link = $this->General->base_url() . 'danh-muc-san-pham/' . $product['product']['product_id'] .'-'. $product['link']['link'] .'.html';
                            ?>
                            <div class="slick-slide">
	                            <a class="actn" href="<?php echo $link ?>">
	    							<img src="<?php echo $this->webroot . $product['image']['name'] ?>"/>
	    						</a>
								<div class="box-price">
									<div class="shadow-price">
										<div class="name">
											<a href="<?php echo $link ?>" class="s-1"><?php echo $product['product_desc']['title'] ?></a>
											<span class="s-2">
												<?php
                                                    if($product['product']['discount']!='' && $product['product']['discount']!=0)
                                                    {
                                                ?>
                									<span class="b">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                                                    </span>
                									<span class="real">
                                                        <?php echo ($product['product']['discount']!='' && $product['product']['discount']!=0) ? number_format($product['product']['discount'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                    else
                                                    {
                                                ?>
                                                    <span class="real">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                ?>
											</span>
										</div>
										<div class="buy"><a order="order" product_id="<?php echo $product['product']['product_id'] ?>" href="javascript:void(0)">Mua</a></div>
									</div>
									<div class="sale"><?php echo ($product['product']['percent_discount'] == '' || $product['product']['percent_discount'] == 0) ? '' : '-'.$product['product']['percent_discount'].'%' ?></div>
								</div>
	                        </div><div class="slick-slide">
	                            <a class="actn" href="<?php echo $link ?>">
	    							<img src="<?php echo $this->webroot . $product['image']['name'] ?>"/>
	    						</a>
								<div class="box-price">
									<div class="shadow-price">
										<div class="name">
											<a href="<?php echo $link ?>" class="s-1"><?php echo $product['product_desc']['title'] ?></a>
											<span class="s-2">
												<?php
                                                    if($product['product']['discount']!='' && $product['product']['discount']!=0)
                                                    {
                                                ?>
                									<span class="b">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                                                    </span>
                									<span class="real">
                                                        <?php echo ($product['product']['discount']!='' && $product['product']['discount']!=0) ? number_format($product['product']['discount'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                    else
                                                    {
                                                ?>
                                                    <span class="real">
                                                        <?php echo ($product['product']['price']!='' && $product['product']['price']!=0) ? number_format($product['product']['price'],0,',','.') .' '. $settings['currency'] : '' ?>
                								    </span>
                                                <?php
                                                    }
                                                ?>
											</span>
										</div>
										<div class="buy"><a order="order" product_id="<?php echo $product['product']['product_id'] ?>" href="javascript:void(0)">Mua</a></div>
									</div>
									<div class="sale"><?php echo ($product['product']['percent_discount'] == '' || $product['product']['percent_discount'] == 0) ? '' : '-'.$product['product']['percent_discount'].'%' ?></div>
								</div>
	                        </div>
                            
	                        <?php
                                }
                             ?>
	                    </div>
                    </div>
                </div>
            </div>
		</div>
	</div>
	<?php echo $this->element('footer'); ?>
</div>